﻿<%@ Page Title="" Language="C#" MasterPageFile="MasterPage.master" AutoEventWireup="true" CodeFile="convocacao.aspx.cs" Inherits="_convocacao" %>

<%@ Register Assembly="DevExpress.Web.v9.1, Version=9.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxTabControl" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v9.1, Version=9.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxClasses" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v9.1, Version=9.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxPopupControl" TagPrefix="dxpc" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v9.1, Version=9.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.v9.1" Namespace="DevExpress.Web.ASPxPopupControl"
    TagPrefix="dxpc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style type="text/css">
        .tabela span
        {
            font: normal normal normal 10pt normal normal tahora, arial;
        }
        .dados
        {
            font-size: 11pt;
        }
        select
        {
            font: normal normal normal 9pt normal normal tahoma, arial;
            padding: 5px;
        }
        
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <%--<script type="text/javascript">        muda(alterar, '#0C5C7E');</script>--%>
    <div style="width:105%; float:left; margin-left:-10px;">
        
        <div style="width:100%; text-align:center; font: bold 30px Tahoma, Arial; color: #006C91;">
            Gestão dos Convocados
        </div>
        <div style="float:left; width:20%; padding-top:27px;">
            <asp:Label ID="lblEmpresa" runat="server" Text="Empresa:" Font-Size="Larger"></asp:Label>
        </div>
        <div style="float:left; width:80%; margin-top:25px;">
            <asp:SqlDataSource ID="dsEmpresas" runat="server" ConnectionString="<%$ ConnectionStrings:conexao_intranet %>"
                               ProviderName="<%$ ConnectionStrings:conexao_intranet.ProviderName %>" SelectCommand="SELECT cnpj, NomeFantasia FROM CamaraEmpresas ORDER BY NomeFantasia">
            </asp:SqlDataSource>
            <asp:DropDownList ID="cboEmpresa" runat="server" AppendDataBoundItems="True" AutoPostBack="True"
                              Width="99%" OnSelectedIndexChanged="cboEmpresa_SelectedIndexChanged" Height="25px"
                              DataSourceID="dsEmpresas" DataTextField="NomeFantasia" DataValueField="cnpj">
                <asp:ListItem></asp:ListItem>
            </asp:DropDownList>
        </div>

        <div id="divEmpresa" runat="server" style="float:left;">
            <div style="float:left; width:20%; padding-top:8px;">
                <asp:Label ID="lblContato" runat="server" Text="Nome:" Font-Size="Larger"></asp:Label>
            </div>
            <div style="float:left; width:80%; padding-top:5px;">
                <asp:TextBox ID="txtNomeContato" runat="server" MaxLength="100" Width="98%" Height="22px" Enabled="false"></asp:TextBox>
            </div>
            <div style="float:left; width:20%; padding-top:8px;">
                <asp:Label ID="lblEmailContato" runat="server" Text="Email:" Font-Size="Larger"></asp:Label>
            </div>
            <div style="float:left; width:80%; padding-top:5px;">
                <asp:TextBox ID="txtEmailContato" runat="server" MaxLength="100" Width="98%" Height="22px" Enabled="false"></asp:TextBox>
            </div>
            <div style="float:left; width:20%; padding-top:8px;">
                <asp:Label ID="lblFoneContato" runat="server" Text="Telefone:" Font-Size="Larger"></asp:Label>
            </div>
            <div style="float:left; width:80%; padding-top:5px;">
                <asp:TextBox ID="txtFoneContato" runat="server" MaxLength="100" Width="98%" Height="22px" Enabled="false"></asp:TextBox>
            </div>
        </div>
        
        <div style="float:left; width:100%; padding-top: 20px;">
            <table style="font: 18px tahoma, arial;">
                <tr>
                    <td align="left" style="font-size: 9pt">
                        <asp:GridView ID="grdConvocados" runat="server" AutoGenerateColumns="False" EnableModelValidation="True" CellPadding="4" ForeColor="#333333" GridLines="None" 
                                      OnRowCommand="grdConvocados_RowCommand" Width="516px"  Visible="False" Style="font-size: 9pt" DataSourceID="dsConvococao" DataKeyNames="cpf">
                            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                            <Columns>
                                <asp:BoundField DataField="nomealuno" HeaderText="Nome">
                                    <HeaderStyle HorizontalAlign="Center" />
                                    <ItemStyle HorizontalAlign="Left"  />
                                </asp:BoundField>
                                <asp:BoundField DataField="email" HeaderText="Email">
                                    <HeaderStyle HorizontalAlign="Center" />
                                    <ItemStyle HorizontalAlign="Left" />
                                </asp:BoundField>
                                <asp:BoundField DataField="telefone" HeaderText="Fone">
                                    <HeaderStyle HorizontalAlign="Center" />
                                    <ItemStyle HorizontalAlign="Center" />
                                </asp:BoundField>
                                <asp:BoundField DataField="vagas" HeaderText="Vg">
                                    <HeaderStyle HorizontalAlign="Center" />
                                    <ItemStyle HorizontalAlign="Center" />
                                </asp:BoundField>
                                    <asp:ButtonField runat="server" ItemStyle-HorizontalAlign="Center" ControlStyle-ForeColor="Blue"
                                                     ControlStyle-Font-Underline="false" ButtonType="Link" CommandName="info" Text="info" />
                            </Columns>
                            <EditRowStyle BackColor="#999999" />
                            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                        </asp:GridView>
                        <asp:SqlDataSource ID="dsConvococao" runat="server" ConnectionString="<%$ ConnectionStrings:conexao_intranet %>"
                            SelectCommand="SELECT insc.cpf, insc.nomeAluno, insc.telefone, insc.email, count(vg.pkIdVaga) as 'vagas' 
                                           FROM CamaraEmpresas emp INNER JOIN CamaraCVVaga vg ON emp.cnpj = vg.fkCnpjEmpresa 
                                                                   INNER JOIN CamaraVaga_Inscritos vginsc ON vg.pkIdVaga = vginsc.fkIdVaga
                                                                   INNER JOIN CamaraInscritos insc ON vginsc.fkIdInscrito = insc.cpf
                                           WHERE emp.cnpj = @cnpj AND vg.vagaAtiva = 1
                                           GROUP BY insc.cpf, insc.nomeAluno, insc.telefone, insc.email
                                           ORDER BY insc.nomeAluno;">
                            <SelectParameters>
                                <asp:ControlParameter ControlID="cboEmpresa" Name="cnpj" PropertyName="SelectedValue" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                    </td>
                </tr>
            </table>
        </div>
    </div>
</asp:Content>
